package com.xjd.io.in;

import java.io.IOException;
import java.io.InputStream;
import java.io.PushbackInputStream;

/**
 * <pre>
 * 通过isEnd方法判断InputStream是否已到结尾
 * </pre>
 * @author  elvis.xu
 * @version 2013-1-9 上午11:58:22
 */
public class IsEndInputStream extends PushbackInputStream {

	public boolean isEnd() throws IOException {
		int i = super.read();
		if (i == -1) {
			return true;
		} else {
			super.unread(i);
			return false;
		}
	}
	
	public IsEndInputStream(InputStream in) {
		super(in);
	}
	

}
